package ua.pp.bizon.yandex.api.impl;

import java.util.EventListener;

import javax.swing.event.EventListenerList;

public class EventSupport {
	private EventListenerList listenerList = new EventListenerList();
	
	public void addListener(ChangeListener l){
		listenerList.add(ChangeListener.class, l);
	}
	
	public void removeListener(ChangeListener l){
		listenerList.remove(ChangeListener.class, l);
	}
	
	public void tourchListeners(){
		for (ChangeListener l: listenerList.getListeners(ChangeListener.class)){
			l.dataChanged();
		}
	}
	public static interface ChangeListener extends EventListener{
		void dataChanged();
	}
}
